{extend name="admin@public/basic" /}

{block name="style"}
<link rel="stylesheet" href="__STATIC__/css/admin/public.css" media="all"/>
{/block}

{block name="cotent"}
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
    <legend>选择需要刷新的节点的模块</legend>
</fieldset>

<form class="layui-form" action="">
    <div class="layui-form-item" pane="">
        <div class="layui-input-block">
            {foreach module_list as $vo}
            <input type="checkbox" name="module" class="layui-input module" value="{$vo.module|default=''}" lay-skin="primary" title="{$vo.module|default=''} {if !empty($vo.title)}（{$vo.title|default=''}）{/if}" {eq name='$vo.is_checked|default=false' value='true' }checked{/eq}>
            {/foreach}
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn" id="refreshNodeBtn">确定刷新节点</button>
        </div>
    </div>
</form>
{/block}

{block name="script"}
<script>

    /**
     * 刷新节点
     */
    $("#refreshNodeBtn").click(function () {
        var module = [];
        $("input:checkbox[name='module']:checked").each(function () {
            module.push($(this).val());
        });
        $.request.post("{:url('@admin/system/refresh_node')}", {module: module,}, function (res) {
            $.msg.success(res.msg);
        });
        return false;
    });
</script>
{/block}